package com.gitee.xhs.savePointReader.keyedState.listStateReader;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author BigHead
 * @date 2022/6/30 10:22
 * @description ListStateExhibitor
 */
public class ListStateExhibitor {

    private String jobId;

    private String operatorUid;

    private Long key;

    private List<Double> stateValueList;

    public String getJobId() {
        return jobId;
    }

    public void setJobId(String jobId) {
        this.jobId = jobId;
    }

    public String getOperatorUid() {
        return operatorUid;
    }

    public void setOperatorUid(String operatorUid) {
        this.operatorUid = operatorUid;
    }

    public Long getKey() {
        return key;
    }

    public void setKey(Long key) {
        this.key = key;
    }

    public List<Double> getStateValueList() {
        return stateValueList;
    }

    public void setStateValueList(List<Double> stateValueList) {
        this.stateValueList = stateValueList;
    }

    public void addStateValueList(Double amount) {
        if (null == stateValueList) {
            stateValueList = new ArrayList<>();
        }
        stateValueList.add(amount);
    }

    @Override
    public String toString() {
        return "ListStateExhibitor{" +
                "jobId='" + jobId + '\'' +
                ", operatorUid='" + operatorUid + '\'' +
                ", key=" + key +
                ", stateValueList='" + stateValueList.stream().map(Object::toString).collect(Collectors.joining(",")) + "'" +
                '}';
    }
}
